#include<bits/stdc++.h>
using namespace std;
const int N=1009;
int n,m,q;
int vis[N][N];
long long ans;
int dx[8]={2,-2,0,0,1,1,-1,-1};
int dy[8]={0,0,2,-2,1,-1,1,-1};
namespace brute1{
    void bfs(int x,int y){
        queue<pair<int,int> > que;
        que.push(make_pair(x,y));
        vis[x][y]=1; ans++;
        int nx,ny,bx,by;
        while(!que.empty()){
            x=que.front().first; y=que.front().second; que.pop();
            for(int i=0;i<8;i++){
                nx=x+dx[i]; ny=y+dy[i];
                if(nx<1||nx>n||ny<1||ny>m||!vis[nx][ny]) continue;
                if(x==nx){
                    bx=x; by=(y+ny)/2;
                    if(!vis[bx][by]){ vis[bx][by]=1; ans++; que.push(make_pair(bx,by));}
                }
                else if(y==ny){
                    by=y; bx=(x+nx)/2;
                    if(!vis[bx][by]){ vis[bx][by]=1; ans++; que.push(make_pair(bx,by));}
                }
                else{
                    bx=x; by=ny;
                    if(!vis[bx][by]){ vis[bx][by]=1; ans++; que.push(make_pair(bx,by));}
                    bx=nx; by=y;
                    if(!vis[bx][by]){ vis[bx][by]=1; ans++; que.push(make_pair(bx,by));}
                }
            }
        }
        return;
    }
    void solve(){
        int x,y;
        while(q--){
            cin>>x>>y;
            if(!vis[x][y])
                bfs(x,y);
//            cout<<ans<<'\n';
        }
        cout<<ans<<'\n';
        return;
    }
}
namespace brute2{
    struct square{
        int lx,ly,rx,ry;
    };
    vector<square> sq;
    square merge(square A,square B){
        return (square){min(A.lx,B.lx),min(A.ly,B.ly),max(A.rx,B.rx),max(A.ry,B.ry)};
    }
    bool judge(pair<int,int> A,pair<int,int> B){
        return (abs(A.second-B.second)<=1&&abs(A.second-B.second)<=1);
    }
    bool judge(square A,square B){
        if(A.lx<=B.rx&&B.lx<=A.rx){
            if(B.ly-2<=A.ly&&A.ly<=B.ry+2) return true;
            if(A.ly-2<=B.ly&&B.ly<=A.ry+2) return true;
        }
        if(A.ly<=B.ry&&B.ly<=A.ry){
            if(B.lx-2<=A.lx&&A.lx<=B.rx+2) return true;
            if(A.lx-2<=B.lx&&B.lx<=A.rx+2) return true;
        }
        return judge(make_pair(A.lx,A.ly),make_pair(B.rx,B.ry))||judge(make_pair(B.lx,B.ly),make_pair(A.rx,A.ry))||judge(make_pair(A.rx,A.ly),make_pair(B.lx,B.ry))||judge(make_pair(B.rx,B.ly),make_pair(A.lx,A.ry));
    }
    void insert(square now){
//        cout<<now.lx<<" "<<now.ly<<" "<<now.rx<<" "<<now.ry<<endl<<endl<<endl;
        ans+=1ll*(now.rx-now.lx+1)*(now.ry-now.ly+1);
        square s;
        for(int i=0;i<sq.size();i++){
            s=sq[i];
            if(judge(s,now)){
 //               cout<<s.lx<<" "<<s.ly<<endl<<now.lx<<" "<<now.ly<<endl;
                swap(sq[i],sq.back());
                sq.pop_back();
                ans-=1ll*(now.rx-now.lx+1)*(now.ry-now.ly+1)+1ll*(s.rx-s.lx+1)*(s.ry-s.ly+1);
                insert(merge(now,s));
                return;
            }
        }
        sq.push_back(now);
        return;
    }
    void solve(){
        int x,y;
        while(q--){
            cin>>x>>y;
            insert((square){x,y,x,y});
   ///         cout<<ans<<'\n';
        }
        cout<<ans<<'\n';
    }
}
int main(){
    freopen("grid.in","r",stdin);
    freopen("grid.out","w",stdout);
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>m>>q;
    if(n<=1000&&m<=1000) brute1::solve();
    else if(q<=1000) brute2::solve();
//    else if(n<=2) brute3::solve();
    return 0;
}